package com.wgy.day14.ArrayList集合;

import java.util.ArrayList;

/**
 * Created by pc on 2020/11/9 23:09
 * Description: LearningJava
 */
public class Demo07ArrayListStudent {
    public static void main(String[] args) {
        Student st1 = new Student("高圆圆", 35);
        Student st2 = new Student("赵又廷", 32);
        Student st3 = new Student("赵丽颖", 30);
        Student st4 = new Student("杨幂", 35);
        ArrayList<Student> list = new ArrayList<>();
        list.add(st1);
        list.add(st2);
        list.add(st3);
        list.add(st4);
        System.out.println(list);
        for (int i = 0; i < list.size(); i++) {
            Student stu = list.get(i);
            System.out.println("姓名：" + stu.getName() + ",年龄：" + stu.getAge());

        }


    }


}
